from django.db import models


# Create your models here.
class BorrowLog(models.Model):
    id = models.AutoField(primary_key=True)
    user = models.ForeignKey('custom_user.CustomUser',
                             on_delete=models.CASCADE,
                             help_text='借用人')
    equipment = models.ForeignKey('equipments.Equipment',
                                 on_delete=models.CASCADE,
                                 help_text='借用资产')
    request_date = models.DateField(help_text='申请日期')
    ought_return = models.DateField(help_text='应还日期')
    actual_return = models.DateField(null=True, help_text='实际归还日期')
    def __str__(self):
        return str(self.request_date)
    class Meta:
        verbose_name = '借用'
        verbose_name_plural = '借用日志'